Packages
library(readr)
Warning: package ‘readr’ was built under R version 4.0.5
library(dplyr)
Warning: package ‘dplyr’ was built under R version 4.0.5
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
library(ggplot2)
Warning: package ‘ggplot2’ was built under R version 4.0.5
library(plotly)
Warning: package ‘plotly’ was built under R version 4.0.5Registered S3 method overwritten by 'data.table':
method from
print.data.table
Registered S3 methods overwritten by 'htmltools':
method from
print.html tools:rstudio
print.shiny.tag tools:rstudio
print.shiny.tag.list tools:rstudio
Registered S3 method overwritten by 'htmlwidgets':
method from
print.htmlwidget tools:rstudio
Attaching package: ‘plotly’
The following object is masked from ‘package:ggplot2’:
last_plot
The following object is masked from ‘package:stats’:
filter
The following object is masked from ‘package:graphics’:
layout
load data
X35020903 <- read_csv("https://ndownloader.figshare.com/files/35020903")
Rows: 1840 Columns: 29── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (27): DepMap_ID, cell_line_name, stripped_cell_line_name, CCLE_Name, ali...
dbl (2): COSMICID, WTSI_Master_Cell_ID
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
X35020903
wrangle data
edit_x35 <- X35020903 %>%
filter(sex %in% "Female" | is.na(sex)) %>%
filter(!(lineage %in% "unknown"))
viz data
dv1 <- ggplot(edit_x35) +
aes(x = primary_disease, fill = lineage) +
geom_bar() +
scale_fill_hue(direction = 1) +
coord_flip() +
theme_minimal()
dv1
ggplotly(dv1)